package com.starview.platform.data.type;

import java.util.Arrays;
import java.util.List;

import com.starview.star.compiler.util.StringUtils;

@SuppressWarnings("serial")
public class TypeConstraintException extends Exception
{
  private final Location locs[];
  private final List<?> words;

  public TypeConstraintException(String detail, Location... locs)
  {
    super(detail);
    this.locs = locs;
    this.words = Arrays.asList(detail);
  }

  public TypeConstraintException(List<?> words, Location... locs)
  {
    super(StringUtils.msg(words));
    this.locs = locs;
    this.words = words;
  }

  public Location[] getLocs()
  {
    return locs;
  }

  public List<?> getWords()
  {
    return words;
  }

}
